import { IsNumber, IsOptional, IsString } from 'class-validator';
import { PaginationQueryDto } from '../../common/dto/pagination-query.dto';
import { IsStringOrNumber } from '../../utils/class-validator/isStringOrNumber';

export class FindAllArticleDto extends PaginationQueryDto {
  @IsOptional()
  @IsNumber()
  status: number = 1;

  @IsOptional()
  @IsString({ each: true })
  tags: string[];

  @IsOptional()
  @IsString()
  category: string;

  @IsOptional()
  @IsString({ each: true })
  years: string[];

  @IsOptional()
  @IsStringOrNumber()
  keyword: string | number;
}
